package zhou.chs.p9_3;

import weiqian.hardware.*;

public class SerialPort {
	private int fd;
	void open(String path, int baud, int databits, String parity, int stopbits) {
		fd = SerialPortJni.OpenSerialPort1(path, baud, databits, parity, stopbits);
	}
	void close() {
		SerialPortJni.CloseSerialPort1(fd);
	}
	int read(byte[] buff, int count, long timeout) {
		return SerialPortJni.ReadSerialPort1(fd, buff, count, timeout);
	}
	int write(byte[] buff, int count) {
		return SerialPortJni.WriteSerialPort1(fd, buff, count);
	}
}
